"""fix user

Revision ID: 181c9db51452
Revises: 9f62bcd3f32e
Create Date: 2024-04-09 19:06:33.402233

"""
from typing import Sequence, Union

from alembic import op
import sqlalchemy as sa


# revision identifiers, used by Alembic.
revision: str = '181c9db51452'
down_revision: Union[str, None] = '9f62bcd3f32e'
branch_labels: Union[str, Sequence[str], None] = None
depends_on: Union[str, Sequence[str], None] = None


def upgrade() -> None:
    # ### commands auto generated by Alembic - please adjust! ###
    op.create_unique_constraint(None, 'Groups', ['id'])
    op.create_foreign_key(None, 'Groups', 'Users', ['trainer_id'], ['id'], use_alter=True)
    op.create_unique_constraint(None, 'Ranks', ['id'])
    op.create_unique_constraint(None, 'Roles', ['id'])
    op.create_unique_constraint(None, 'Tasks', ['id'])
    op.add_column('Users', sa.Column('deleted', sa.Boolean(), nullable=True))
    op.create_unique_constraint(None, 'Users', ['id'])
    # ### end Alembic commands ###


def downgrade() -> None:
    # ### commands auto generated by Alembic - please adjust! ###
    op.drop_constraint(None, 'Users', type_='unique')
    op.drop_column('Users', 'deleted')
    op.drop_constraint(None, 'Tasks', type_='unique')
    op.drop_constraint(None, 'Roles', type_='unique')
    op.drop_constraint(None, 'Ranks', type_='unique')
    op.drop_constraint(None, 'Groups', type_='foreignkey')
    op.drop_constraint(None, 'Groups', type_='unique')
    # ### end Alembic commands ###
